package sfms.util;


public class PasswordValidator {
    public static boolean validate(String password) {
        return (password != null && password.length() >= 8 && password.matches(".*\\d.*") && containsLetter(password));
    }
    
    public static boolean containsLetter(String s) {

        for (int i = 0; i < s.length(); i++) {
            if (Character.isLetter(s.charAt(i))) {
                return true;
            }
        }
        return false;
    }
}
